#include <bits/stdc++.h>

using namespace std;

int main_1049()
{
    int ans=0,a=1,N,left,now,right;
    scanf("%d",&N);
    while (N/a!=0)
    {
        now=N/a%10;
        left=N/(a*10);
        right=N%a;
        if (now==0)
        {
            ans+=left*a;
        }
        else if (now==1)
        {
            ans+=left*a+right+1;
        }
        else
        {
            ans+=(left+1)*a;
        }
        a*=10;
    }
    printf("%d",ans);
    return 0;
}
